--
-- Description: script to create the Products table.
-- Date created: 17 Apr 2008
--

set ANSI_NULLS on
set QUOTED_IDENTIFIER on
go

if not exists 
(
    select * 
    from dbo.sysobjects
    where id = object_id(N'[dbo].[Products]')
    and objectproperty(id, N'IsUserTable') = 1
)
begin
    create table [dbo].[Products]
    (
        [ProductID] int not null
        , [ProductName] nvarchar(50) not null
        , [ProductVersion] nvarchar(50) null
        , [DateCreated] smalldatetime not null
        , [DateModified] smalldatetime not null
        , [TotalEvents] int not null
        constraint [PK_Products] primary key clustered
        (
            [ProductID] asc
        ) on [primary]
    ) on [primary]

    print ''
    print '*************************************************************************************'  
    print 'Created table [dbo].[Products]'
    print '*************************************************************************************'  
    print ''
end
else
begin
    print ''
    print '*************************************************************************************'  
    print 'Table [dbo].[Products] already exists.'
    print '*************************************************************************************'  
    print ''
end
